<%@page contentType="text/html;charset=UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

	       <!DOCTYPE html>
	<html>
		<head>
			<meta charset='utf-8'>
			<title>部门</title>
			<base href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/">
	<script type='text/javascript'>
		function del(No){
			var ok=window.confirm('您是否要删除？');
			if(ok){
				document.location.href="${pageContext.request.contextPath}/dept/delete?deptNo="+No;
			}
		}

	  </script>
			</head>

			<body>
			<h1>你好，${username}!</h1>
			<h2><a href="dept/logout">[退出系统]</a> </h2>
			<hr>
				<div align='center'>
					<h1><font size='200pix' color='blue'>部门</font></h1>
				</div>

				<hr>
				<br><br><br>
				<table align='center' border='1pix' width='600pix' height='300pix'>
					<tr>
						<th>序号</th>
						<th>部门编号</th>
						<th>部门名称</th>
						<th>部门位置</th>
						<th>操作</th>
					</tr>

					<c:forEach items="${deptList}" var="dept" varStatus="no">
						<tr>
							<td align='center'>${no.count}</td>
							<td align='center'>${dept.deptNo}</td>
							<td align='center'>${dept.dname}</td>
							<td align='center'>${dept.loc}</td>
							<td align='center'><a href="dept/details?deptNo=${dept.deptNo}&flag=details">详情</a> &nbsp;
								<a href="dept/details?deptNo=${dept.deptNo}&no=${no.count}&flag=modify">修改</a> &nbsp;
								<a href="javascript:void(0)" onclick='del(${dept.deptNo})'>删除</a></td>
						</tr>
					</c:forEach>

							</table>

							<br><br><br>
							<hr>
							<a href="add.jsp"><font size='5cm' color='red'>新增部门</font></a>
						</body>
					</html>